package com.jzoffer;

import java.util.Scanner;

public class IntegerPower {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        double base = scanner.nextDouble();
        int exponent = scanner.nextInt();
        double res = Power(base,exponent);
        System.out.println(res);

    }

    public static double Power(double base, int exponent){
        if(exponent == 0){
            return 1.0;
        }else if(exponent == 1){
            return base;
        }else{
            boolean isNegative = exponent < 0;
            exponent = exponent < 0 ? -exponent : exponent;
            double res = 1.0;

            for(int i = 0;i < exponent / 2;i++){
                res = res * base * base;
            }

            if((exponent & 1) == 1){
                res = res * base;
            }
            return isNegative?1 / res : res;
        }

    }
}
